﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using BCGC.BLL.Helper;
using BCGC.BLL.BusinessObject.Resource;
using Jalal.Library.Utility;

public partial class Resources_CheatCodeDetail : PublicBasePage
{
    private int Id
    {
        get
        {
            if (ViewState["Id"] == null)
                ViewState["Id"] = 0;
            return (int)ViewState["Id"];
        }
        set { ViewState["Id"] = value; }
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            int id = Id = 0;
            if (!string.IsNullOrEmpty(Request.QueryString["id"]) && int.TryParse(Request.QueryString["id"], out id))
            {
                Id = id;
                LoadResources();
            }
            else
                Response.Redirect(CustomSiteMap.GameCheatCodes);
        }
    }

    private void LoadResources()
    {
        CheatCode cheatCode = CheatCode.GetCheatCodeById(Id);
        lblTitle.Text = cheatCode.Title;
        lblCreateDate.Text = CommonUtility.FormatedDateString(cheatCode.CreateDateTime);
        ltlShortDescription.Text = Server.HtmlDecode(cheatCode.Description);
        ltlCheatCodeDetail.Text = Server.HtmlDecode(cheatCode.CheatCodeDetail);
    }
}
